<template>
  <div class="SetUp">
    <van-nav-bar
      title="设置"
      left-text="返回"
      right-text="更改"
      left-arrow
      @click-left="onClickLeft"
      @click-right="onClickRight"
    />
    <div class="ovs">
      <div class="user_head">
        <div class="head_lfet">
          <p class="portrait">
            <van-uploader :after-read="afterRead" />
          </p>
          <p class="user_m">美衣橱</p>
        </div>
        <div class="head_right">
          <van-button round type="danger">编辑</van-button>
        </div>
      </div>
      <div class="sheList">
        <ul>
          <li @click="address">
            <p>我的收获地址</p>
            <van-icon name="arrow" />
          </li>
          <li>
            <p>账户设置与安全</p>
            <van-icon name="arrow" />
          </li>
          <li>
            <p>支付设置</p>
            <van-icon name="arrow" />
          </li>
          <li>
            <p>地区设置</p>
            <van-icon name="arrow" />
          </li>
          <li>
            <p>隐私</p>
            <van-icon name="arrow" />
          </li>
          <li>
            <p>通用</p>
            <van-icon name="arrow" />
          </li>
          <li>
            <p>问题与反馈</p>
            <van-icon name="arrow" />
          </li>
          <li @click="tuichu">
            <p>退出账号</p>
            <van-icon name="arrow" />
          </li>
        </ul>
      </div>
    </div>
  </div>
</template>

<script>
import { Toast } from "vant";
import { removeToken } from "../utils/auth";
export default {
  data() {
    return {
      // fileList: [
      //   { url: "https://img.yzcdn.cn/vant/leaf.jpg" },
      //   // Uploader 根据文件后缀来判断是否为图片文件
      //   // 如果图片 URL 中不包含类型信息，可以添加 isImage 标记来声明
      //   { url: "https://cloud-image", isImage: true },
      // ],
    };
  },
  methods: {
    onClickLeft() {
      Toast("返回");
      this.$router.push({
        name: "User",
      });
    },
    onClickRight() {
      Toast("按钮");
    },
    afterRead(file) {
      // 此时可以自行将文件上传至服务器
      console.log(file);
    },
    address() {
      this.$router.push({
        name: "AddressList",
      });
    },
    tuichu() {
      removeToken();
      this.$router.push({
        name: "Login",
      });
    },
  },
};
</script>

<style scoped>
.SetUp .user_head {
  width: 94%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
}
.SetUp .portrait {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin-right: 10px;
  font-size: 24px;
  overflow: hidden;
}
.SetUp .head_lfet {
  display: flex;
  justify-content: flex-start;
}
.SetUp .head_lfet .user_m {
  font-size: 20px;
}
.SetUp .head_lfet .user_m {
  font-size: 20px;
}
.SetUp .head_right {
  width: 20%;
  padding-top: 16px;
  display: flex;
  justify-content: space-between;
}
.SetUp .sheList {
  width: 94%;
  margin: 0 auto;
}
.SetUp .sheList li {
  height: 45px;
  display: flex;
  /*两端对齐*/
  justify-content: space-between;
  align-items: center;
  font-size: 18px;
  background: #eee;
  margin-bottom: 10px;
  padding: 0 10px;
  border-radius: 20px;
}
</style>